extends CharacterBody2D

class_name PlayerDeath

var gravity: int = 800
signal death_ended

func _ready() -> void:
	$DeathSoundsPlayer.play()
	$DeathSoundsPlayer2.play()
	$DeathSoundsPlayer3.play()
	var main = get_tree().get_nodes_in_group("main")[0]
	death_ended.connect(main.on_death_ended)

func _physics_process(delta: float) -> void:
	velocity.y += gravity * delta
	move_and_slide()

func emit_death_ended():
	death_ended.emit()
